package com.itheima_06;

import java.util.Scanner;

/**
 * @author Xiao
 * @date 2021/7/6
 */
public class ReverseStringBuilder {
    /*
        对称字符串
            键盘接受一个字符串，程序判断出该字符串是否是对称字符串，
            并在控制台打印是或者不是
     */
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个字符串：");
        String s = sc.nextLine();
        System.out.println("------------------");
        StringBuilder sb = new StringBuilder(s);
        StringBuilder re = sb.reverse();
        String s1 = re.toString();
        if (s1.equals(s)) {
            System.out.println("您输入的字符串是对称字符串。");
        } else {
            System.out.println("您输入的字符串不是对称字符串。");
        }
    }
}
